
$(function(){
    // 折线图 1
    var data = [{
        year: '沟通表达',
        value: 3
      }, {
        year: '理性思维',
        value: 4
      }, {
        year: '细节洞察',
        value: 1
      }, {   
        year: '部署安排',
        value: 5
      }];
      var chart = new G2.Chart({
        container: 'chart-1',
        forceFit: true,
        height: 300,
        padding:'auto'
      });
      chart.source(data);
      chart.scale('value', {
        min: 0
      });
      chart.scale('year', {
        range: [0, 1]
      });
      chart.tooltip({
        crosshairs: {
          type: 'line'
        }
      });
      chart.line().position('year*value');
      chart.point().position('year*value').size(4).shape('circle').style({
        stroke: '#fff',
        lineWidth: 1
      });
      chart.render();

    //   基本管理素质
    var data2 = [{
        year: '挑战意识',
        value: 3
      }, {
        year: '亲和动机',
        value: 4
      }, {
        year: '解决问题',
        value: 1
      }, {
        year: '创新意识',
        value: 5
      },{
        year: '决断力',
        value: 3
      },{
        year: '灵活性',
        value: 4
      },{
        year: '分析能力',
        value: 5
      },{
        year: '主动性',
        value: 7
      },{
        year: '责任心',
        value: 2
      },{
        year: '说服力',
        value: 9
      },{
        year: '压力管理',
        value: 6
      },{
        year: '情绪稳定性',
        value: 1
      },{
        year: '感召力',
        value: 2
      },{
        year: '团队协作',
        value: 3
      },{
        year: '人际敏感',
        value: 7
      },];
      var chart = new G2.Chart({
        container: 'chart-2',
        forceFit: true,
        height: 400,
        padding:[20,50,40,20]
      });
      chart.source(data2);
      chart.scale('value', {
        min: 0
      });
      chart.scale('year', {
        range: [0, 1]
      });
      chart.tooltip({
        crosshairs: {
          type: 'line'
        }
      });
      chart.line().position('year*value');
      chart.point().position('year*value').size(5).shape('circle').style({
        stroke: '#fff',
        lineWidth: 1
      });
      chart.render();
    //   核心管理潜质
    var data2 = [{
        year: '计划潜质',
        sales: 38
      }, {
        year: '组织潜质',
        sales: 52
      }, {
        year: '执行潜质',
        sales: 61
      }, {
        year: '监督潜质',
        sales: 145
      }];
      var chart = new G2.Chart({
        container: 'chart-3',
        forceFit: true,
        height: 300,
        padding:'auto'
      });
      chart.source(data2);
      chart.scale('sales', {
        tickInterval: 20
      });
      chart.interval().position('year*sales');
      chart.render();
    //   核心管理潜质  - 1
    var data3_1 = [{
        year: '挑战意识',
        value: 3
      }, {
        year: '亲和动机',
        value: 4
      }, {
        year: '解决问题',
        value: 1
      }, {
        year: '创新意识',
        value: 5
      },{
        year: '决断力',
        value: 3
      },{
        year: '灵活性',
        value: 4
      },{
        year: '分析能力',
        value: 5
      },{
        year: '主动性',
        value: 7
      },{
        year: '责任心',
        value: 2
      },{
        year: '说服力',
        value: 9
      },{
        year: '压力管理',
        value: 6
      },{
        year: '情绪稳定性',
        value: 1
      },{
        year: '感召力',
        value: 2
      },{
        year: '团队协作',
        value: 3
      },{
        year: '人际敏感',
        value: 7
      },];
      var chart = new G2.Chart({
        container: 'chart-3-1',
        forceFit: true,
        height: 400,
        padding:[20,50,40,20]
      });
      chart.source(data3_1);
      chart.scale('value', {
        min: 0
      });
      chart.scale('year', {
        range: [0, 1]
      });
      chart.tooltip({
        crosshairs: {
          type: 'line'
        }
      });
      chart.line().position('year*value');
      chart.point().position('year*value').size(5).shape('circle').style({
        stroke: '#fff',
        lineWidth: 1
      });
      chart.render();
    //   潜在管理风格
    var data4 = [{
        item: '参与式',
        count: 25,
        percent: 0.4
      }, {
        item: '教练式',
        count: 25,
        percent: 0.21
      }, {
        item: '放权式',
        count: 25,
        percent: 0.17
      }, {
        item: '指示式',
        count: 25,
        percent: 0.13
      }];
      var chart = new G2.Chart({
        container: 'chart-4',
        forceFit: true,
        height: 300,
        padding:'auto'
      });
      chart.source(data4, {
        percent: {
          formatter: function formatter(val) {
            val = val * 100 + '%';
            return val;
          }
        }
      });
      chart.coord('theta');
      chart.tooltip({
        showTitle: false
      });
      chart.intervalStack().position('percent').color('item').label('percent', {
        offset: -40,
        // autoRotate: false,
        textStyle: {
          textAlign: 'center',
          shadowBlur: 2,
          shadowColor: 'rgba(0, 0, 0, .45)'
        }
      }).tooltip('item*percent', function(item, percent) {
        percent = percent * 100 + '%';
        return {
          name: item,
          value: percent
        };
      }).style({
        lineWidth: 1,
        stroke: '#fff'
      });
      chart.render();
})
